package com.edu.imau.FixedParking;

import com.edu.imau.ParkingDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/FixedDelete")
public class FixedDeleteServlet extends HttpServlet {
    ParkingDao dao = new ParkingDao();
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //1:处理参数
        String fixed_id = request.getParameter("fixed_id");
        //2 调用model
        if(fixed_id != null){
            dao.deleteFixed(Integer.parseInt(fixed_id));
            //3；展示数据View
            response.sendRedirect("Fixed.jsp");
        }
    }
}